Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-design logic for commandfor form-owner combinations #49594

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Dec 9, 2024

In whatwg/html#9841 the behaviour for
commandfor= as a form owner has subtly changed:

  • <button commandfor=> (implicit submit) that has a form owner
    now does nothing (so we will log a warning to the console telling
    the user that this is the case and they should add type=button to
    make it a command button).
  • <button type=reset command..> and <button type=submit command..>
    that have a form owner should do the behaviour explicitly laid out
    by their type, and ignore and command/commandfor attributes
    semantics. In this case we log a warning to the console telling
    the user that the command/commandfor are being ignored.

To keep changes light here, only the
DefaultEventHandler/CommandForElement logic has changed; a more
significant refactor might be needed to adjust type_ to ensure it does not resolve to kSubmit implicitly, but that should be handled more delicately, I believe.

Bug: 382238696
Change-Id: I7d5583d34a2d615faeed80905816edb3f261d60d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6070260
Auto-Submit: Keith Cirkel <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Keith Cirkel <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1393810}

In whatwg/html#9841 the behaviour for
commandfor= as a form owner has subtly changed:

 - <button commandfor=> (implicit submit) that has a form owner
   now does nothing (so we will log a warning to the console telling
   the user that this is the case and they should add `type=button` to
   make it a command button).
 - <button type=reset command..> and <button type=submit command..>
   that have a form owner should do the behaviour explicitly laid out
   by their `type`, and ignore and `command`/`commandfor` attributes
   semantics. In this case we log a warning to the console telling
   the user that the command/commandfor are being ignored.

To keep changes light here, only the
DefaultEventHandler/CommandForElement logic has changed; a more
significant refactor might be needed to adjust `type_` to ensure it does not resolve to `kSubmit` implicitly, but that should be handled more delicately, I believe.

Bug: 382238696
Change-Id: I7d5583d34a2d615faeed80905816edb3f261d60d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6070260
Auto-Submit: Keith Cirkel <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Keith Cirkel <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1393810}
Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 3d3ea3a into master Dec 9, 2024
21 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-6070260 branch December 9, 2024 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants